import {State, StateMachine} from "../stateMachine";
import {getGameObjectById, Transform} from "../gameengine";

export class SceneMoveMachine extends StateMachine{

    public static moveX(speed:number){
        const sceneTransform=getGameObjectById("Scene").getScript(Transform);
        sceneTransform.x+=speed;
    }

    public static moveY(speed:number){
        const sceneTransform=getGameObjectById("Scene").getScript(Transform);
        sceneTransform.y+=speed;
    }

}

export class SceneStillState extends State{

    onEnter() {
    }

    onExit() {
    }

}

export class SceneFollowState extends State{

    constructor(speedX:number,speedY:number){
        super();
        SceneMoveMachine.moveX(speedX);
        SceneMoveMachine.moveY(speedY)
    }

    onEnter() {
    }

    onExit() {
    }

}

export const sceneMoveMachine=new SceneMoveMachine();